﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using EkejiWeb.BLL;
using EkejiWeb.Model;
using System.Web.UI.WebControls;

namespace EkejiWeb.Web.UserVip.UsrVip
{
    public partial class Register : System.Web.UI.Page
    {
        UserVipBLL bll = new UserVipBLL();
        UserVipModel model = new UserVipModel();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {

            }
        }

        protected void leftsub_Click(object sender, EventArgs e)
        {
            this.user.Text = "";
            this.password.Text = "";
            this.password2.Text = "";
            this.tbProfessional.Text = "";
            this.id.Text = "";
            this.QQ.Text = "";
            this.Tel.Text = "";
            this.address.Text = "";
        }

        protected void rightsub_Click(object sender, EventArgs e)
        {
            Boolean flag = false;
            model.UserName = this.user.Text.Trim();
            model.PassWord = this.password.Text.Trim();
            model.Type = this.tbType.SelectedItem.Text.Trim();
            model.Depart = this.ddlDepart.SelectedItem.Text.Trim();
            model.Professional = this.tbProfessional.Text.Trim();
            model.IdCard = this.id.Text.Trim();
            model.QQ = this.QQ.Text.Trim();
            model.Tel = this.Tel.Text.Trim();
            model.Adress = this.address.Text.Trim();
            flag = bll.AddUserVip(model);
            if (flag)
            {
                Response.Write("<Script Language=JavaScript>alert('注册成功！');</Script>");
                //Response.Redirect("~/Login/Login.aspx");
            }
            else
            {
                Response.Write("<Script Language=JavaScript>alert('注册失败！');</Script>");
                return;
            }
        }
    }
}